//
//  InterestChoiceViewController.m
//  BeanSproutEDU
//
//  Created by douya on 15/1/6.
//  Copyright (c) 2015年 douya. All rights reserved.
//

#import "InterestChoiceViewController.h"
#import "LoginViewController.h"
#import "Header.h"
@interface InterestChoiceViewController ()

@end

@implementation InterestChoiceViewController

-(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [MobClick beginLogPageView:@"InterestChoiceView"];
}

-(void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [MobClick endLogPageView:@"InterestChoiceView"];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title=@"兴趣爱好";
    self.navigationController.navigationBar.titleTextAttributes=[NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];

    self.navigationController.navigationBar.barTintColor=DOUYACOLOR;
    
    for (UIView *view in [self.view subviews])
    {
        if ([view isKindOfClass:[UIButton class]])
        {
            UIButton *btn=(UIButton *)view;
            if (btn.tag<3)
            {
                btn.layer.cornerRadius=5;
                btn.layer.shadowColor=[UIColor grayColor].CGColor;//阴影颜色
                btn.layer.shadowOffset=CGSizeMake(6, 6);//阴影的方向
                btn.layer.shadowOpacity=0.5;//阴影透明度
            }
            else if (btn.tag>3)
            {
                btn.layer.cornerRadius=5;
                btn.layer.shadowColor=[UIColor grayColor].CGColor;//阴影颜色
                btn.layer.shadowOffset=CGSizeMake(10, 10);//阴影的方向
                btn.layer.shadowOpacity=0.5;//阴影透明度
            }
           
        }
    }
    
   
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (BOOL)shouldAutorotate

{
    return NO;
    
}


#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}

//年龄选择
- (IBAction)ageSelectBtnClick:(UIButton *)sender
{
    [_selectBtn setBackgroundColor:[UIColor lightGrayColor]];
    UIButton *button=(UIButton *)sender;
    [button setBackgroundColor:[UIColor greenColor]];
    _selectBtn=button;
}
//兴趣选择
- (IBAction)InterestSelectBtnClick:(selectBtn *)sender
{
    selectBtn *button=(selectBtn *)sender;
    button.isSelect=!button.isSelect;
    if (button.isSelect)
    {
        [button setBackgroundColor:[UIColor greenColor]];
        [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    }
    else
    {
        [button setBackgroundColor:[UIColor colorWithRed:245/255.0 green:252/255.0 blue:174/255.0 alpha:1]];
        [button setTitleColor:[UIColor colorWithRed:31/255.0 green:110/255.0 blue:250/255.0 alpha:1] forState:UIControlStateNormal];
    }
    
}



- (IBAction)nextBtnClick:(UIButton *)sender
{
    LoginViewController *login=[[LoginViewController alloc] init];
   
    OrientationNavigationController *nav=[[OrientationNavigationController alloc] initWithRootViewController:login];
     [self.navigationController presentViewController:nav animated:YES completion:nil];
}

//- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
//
//{
//    
//    return (toInterfaceOrientation == UIInterfaceOrientationPortrait);
//    
//}

@end
